#pragma once

#include <fstream>
#include <vector>

class QueryTerm;
class Query;
class StopWords;
class PorterStemmingAlgorithm;

class QueryManager
{
public:
	QueryManager(std::string &filename, char *stopfilename);
	virtual ~QueryManager(void); 
	unsigned int GetQueryCount(void) { return m_QueryCount; };
	QueryTerm * GetQueryTerm( unsigned int index );
	std::string & GetQuery(unsigned int index) { return m_strQuery[index]; };
	typedef std::vector < QueryTerm* > QueryTermVector;
private:
	std::ifstream m_FileStream;
	QueryTermVector m_QueryTermVec;
	Query * m_pQuery;
	StopWords* m_StopWords;
	PorterStemmingAlgorithm* m_PorterStemmingAlgorithm;
	std::vector < std::string > m_strQuery;

	unsigned int m_QueryCount;

	void QueryManager::ParseString(QueryTerm* pQueryTerm, std::string& str, int multiplier, bool isEnchant = false);
	std::vector<std::string> QueryManager::Tokenize(std::string& str,std::string& delimiters);
};

